<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/User.Master" Inherits="System.Web.Mvc.ViewPage<mesoBoard.Data.UserProfile>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

    <fieldset>
        <legend><%= Html.ThemeImage("change_avatar.png")%> Avatar Options</legend>

        <div style="float:left; padding-top: 50px; width: 30%; text-align: center">
            <% if(!string.IsNullOrEmpty(Model.Avatar)){ %>
            <%= Html.UserAvatar(Model.UserID) %>
            <br />
            Current Avatar
            <%} else{%>
            No Avatar
            <%} %>
        </div>
        <div style="float: left">
            <form method="post" enctype="multipart/form-data">
                <dl>
                    <dt>
                        <%= Html.RadioButton("AvatarType", "None", Model.AvatarType == "None", new { id="AvatarNone" })%>
                        <label for="AvatarNone">None</label>
                    </dt>
                                
                    <dt>
                        <%= Html.RadioButton("AvatarType", "Url", Model.AvatarType == "Url", new { id = "AvatarUrl" })%>
                        <label for="AvatarUrl">External Image URL</label>
                    </dt>
                    <dd>
                        <%= Html.TextBox("ExternalImageURL", Model.AvatarType == "Url" ? Model.Avatar : "", new { style="width: 300px" })%>
                        <%= Html.ValidationMessage("ExternalImageURL")%>
                    </dd>
                    
                    <dt>
                        <%= Html.RadioButton("AvatarType", "Upload", Model.AvatarType == "Upload", new { id = "AvatarUpload" })%>
                        <label for="AvatarUpload">Upload Avatar Image</label>
                    </dt>
                    <dd>
                        <input type="file" name="ImageUpload" />
                        <%= Html.ValidationMessage("ImageUpload") %>
                        <label style="display:block">
                            png,gif,jpeg,jpg only<br />
                            <%= mesoBoard.Services.SiteConfig.AvatarWidth + "px"%> x <%= mesoBoard.Services.SiteConfig.AvatarHeight + "px"%><br />
                            <%= mesoBoard.Services.SiteConfig.AvatarFileSize%> kb max size
                        </label>   
                    </dd>
                    
                    <dt>&nbsp;</dt>
                    <dd>
                        <%= Html.SubmitButton("SaveChanges", "Save Changes")%>
                    </dd>
                </dl>
            </form>
        </div>
    </fieldset>
    
</asp:Content>
